<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <title>仪表板 - SimpleHire</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        /* 统一的CSS变量 */
        :root {
            --primary-color: #5A67D8;
            --primary-hover: #434B9A;
            --text-color: #2D3748;
            --light-gray: #F7FAFC;
            --border-color: #E2E8F0;
            --error-color: #E53E3E;
        }

        body {
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--light-gray);
            color: var(--text-color);
        }

        .header {
            background-color: white; /* 改变头部背景色 */
            border-bottom: 1px solid var(--border-color);
            padding: 1.5rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .header h1 {
            font-size: 1.5rem;
            margin: 0;
            font-weight: 600;
        }

        .container {
            padding: 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        .welcome {
            background: white;
            padding: 2rem;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            margin-bottom: 2rem;
        }

        .welcome h2 {
            font-size: 1.75rem;
            margin-bottom: 1rem;
            color: var(--primary-color);
        }

        .card {
            border: none; /* 移除默认边框 */
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* 更明显的阴影 */
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
        }

        .card-body h5 {
            font-weight: 600;
            margin-bottom: 0.75rem;
            color: var(--primary-color);
        }

        .card-body p {
            color: #6C757D;
        }

        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            font-weight: 600;
            transition: background-color 0.3s ease, border-color 0.3s ease;
        }

        .btn-primary:hover {
            background-color: var(--primary-hover);
            border-color: var(--primary-hover);
        }

        .admin-btn, .logout-btn {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            text-decoration: none;
            font-size: 0.95rem;
            font-weight: 500;
            transition: background-color 0.3s ease;
            display: inline-flex;
            align-items: center;
        }

        .admin-btn {
            background-color: #2D3748; /* 深色按钮 */
            color: white;
        }

        .admin-btn:hover {
            background-color: #4A5568;
        }

        .logout-btn {
            background-color: #E53E3E; /* 红色按钮 */
            color: white;
            border: none;
            cursor: pointer;
        }

        .logout-btn:hover {
            background-color: #C53030;
        }

        .btn i {
            margin-right: 8px;
        }

        /* 布局调整 */
        .header-buttons {
            display: flex;
            gap: 1rem;
        }

    </style>
</head>
<body>
<div class="header">
    <h1><i class="bi bi-speedometer2"></i> SimpleHire </h1>
    <div class="header-buttons">
        <div sec:authorize="hasRole('ADMIN')">
            <a th:href="@{/admin/users}" class="admin-btn">
                <i class="bi bi-gear"></i> 管理界面
            </a>
        </div>
        <form class="d-inline" th:action="@{/logout}" method="post">
            <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
            <button type="submit" class="logout-btn">
                <i class="bi bi-box-arrow-right"></i> 登出
            </button>
        </form>
    </div>
</div>

<div class="container">
    <div class="welcome">
        <h2>欢迎使用 SimpleHire!</h2>
        <p>在这里，您可以进行模拟面试，并查看您的面试记录。</p>
    </div>

    <div class="row justify-content-center">
        <div class="col-md-6 mb-4">
            <div class="card h-100">
                <div class="card-body">
                    <h5 class="card-title"><i class="bi bi-person-video2"></i> AI 面试评分</h5>
                    <p class="card-text">上传您的简历，AI将自动评估您的表现并提供详细反馈。</p>
                    <a th:href="@{/interview}" class="btn btn-primary mt-auto">开始面试</a>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>